import { watch } from 'vue'
import useLocale from './useLocale'

export default function useLocaleNavigationBarTitle(title) {
    const { t, locale } = useLocale()

    watch(
        locale,
        () => {
            uni.setNavigationBarTitle({
                title: t(title),
            })
        },
        { immediate: true },
    )
}
